<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "radio".
 *
 * @property int $id
 * @property int $tid 出题人id
 * @property string $title 单选题的题目
 * @property string $options 单选题的所有选项
 * @property string $answer 正确答案
 */
class Radio extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'radio';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['tid', 'title', 'options', 'answer'], 'required'],
            [['tid'], 'integer'],
            [['title', 'options'], 'string', 'max' => 255],
            [['answer'], 'string', 'max' => 5],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'tid' => 'Tid',
            'title' => 'Title',
            'options' => 'Options',
            'answer' => 'Answer',
        ];
    }
}
